import Vue from 'vue'
// 直接将Vue组件作为Vue.extend的参数
import choiceOrg from "./choiceOrg";


const showChoiceOrg = (data, config) => {
    let showData = data.showData || null;
    let replaceFields = data.replaceFields || null;
    let multiple = data.multiple || false;
    const choiceTreeConstructor = Vue.extend(choiceOrg);
    const instance = new choiceTreeConstructor({
        el: document.createElement("div")
    });

    document.querySelector("body").appendChild(instance.$el);
    return instance.show(showData, replaceFields, multiple, config);
}

export default showChoiceOrg;